<?php
define('YANGJIFANG',true);

$message = '';

if($_SERVER['REQUEST_METHOD'] == 'POST'){

    $username = isset($_POST['username'])?trim($_POST['username']):'';
    $password = isset($_POST['password'])?trim($_POST['password']):'';

    if(md5($username) == 'e03ec235db2939d7165074c766d30587' && md5($password) == '8ecb688db90d6bb66df3ecde6ee7d7c3'){
        session_start();
        $_SESSION['is_login'] = 'yes';
        header("Location:/admin.php");
    }else{
        $message = '是不是密码不对了 老兄!';
    }
}
?>
<html>
<head>
    <style type="text/css">
        .title{
            padding:10px 0;
        }
        input{
            width:500px;
        }
        .content textarea{
            height:500px;
            width:500px;
        }
        .submit{
            padding:10px 0 10px 50px;
        }
    </style>
</head>
<body>
<div><?php echo $message; ?></div>
<form action="" method="post">
    <div class="title">
        用户：<input type="text" name="username" />
    </div>
    <div class="content">
        密码：<input type="password" name="password" value="">
    </div>
    <div class="submit">
        <button type="submit">提交</button>
    </div>
</form>
</body>
</html>